#include <stdio.h>
#include <malloc.h>
#include <stdbool.h>

void Swap(int *a,int*b)
{
	int temp = *a;
	*a = *b;
	*b = temp;
}

void selectSort(int* arr, int n)
{
	int begin = 0, end = n - 1;
	int maxi, mini;
	while (begin < end)
	{
		maxi = begin;
		mini = begin;
		for (int i = begin; i <= end; i++)
		{
			if (arr[i] > arr[maxi])
			{
				maxi = i;
			}
			if (arr[i] < arr[mini])
			{
				mini = i;
			}
		}
		Swap(&arr[begin], &arr[mini]);
		if (maxi == begin)
		{
			maxi = mini;
		}
		Swap(&arr[end], &arr[maxi]);
		begin++;
		end--;
	}


}
int main()
{
   
    return 0;
}
